<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/6
 * Time: 20:55
 */


require_once "../config/config.php";
require_once "../model/adminDb.php";

$adminDb = new adminDb();
$id = $_POST['id'];
$person = $_POST['person'];
$reason=$_POST['reason'];
$data=$adminDb->updatePerson($id,$person,$reason);

try {

    if ($data) {
        $dat = array(
            'msg' => "修改成功",
            "code" => 200,

        );
        echo json_encode($dat);
    } else {
        $dat = array(
            "code" => 404,
            'msg' => "修改失败",

        );
        echo json_encode($dat);

    }
} catch (Exception $e) {

    // 回滚事务
    // $pdo->rollback();
    echo $e->getMessage();
}













